
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import { $http } from '@escook/request-miniprogram'
import store from '@/store/store.js'

Vue.config.productionTip = false

App.mpType = 'app'
uni.$http = $http
// 设置基础路径
$http.baseUrl='https://www.uinav.com'

uni.$showMsg=function(title='数据加载失败',duration=1500){
  uni.showToast({
    title,
    duration,
    icon:'none'
  })
}
//请求拦截器
$http.beforeRequest = function (options) {
  uni.showLoading({
    text:'数据加载中'
  })
}

//响应拦截器  请求完成之后做一些事情
$http.afterRequest = function () {
  uni.hideLoading()
}
const app = new Vue({
    ...App,
    store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif